package com.sinosoft.entity;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;

public class DefPrivilege {
    private Long privilegeId;

    private String privilegeCode;

    private String privilegeName;

    private String privilegeType;

    private String url;

    private Long pid;
    
    private String icon;

    private String rcState;

    private Date createDate;

    private Date modifyDate;

    private Long createUserId;

    private Long modifyUserId;
    
    private Integer start; //分页查询时的查询起点
    
    private Integer rows; //分页查询时的每页展示条数

    public Integer getStart() {
		return start;
	}

	public void setStart(Integer start) {
		this.start = start;
	}

	public Integer getRows() {
		return rows;
	}

	public void setRows(Integer rows) {
		this.rows = rows;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public Long getPrivilegeId() {
        return privilegeId;
    }

    public void setPrivilegeId(Long privilegeId) {
        this.privilegeId = privilegeId;
    }

    public String getPrivilegeCode() {
        return privilegeCode;
    }

    public void setPrivilegeCode(String privilegeCode) {
        this.privilegeCode = StringUtils.isBlank(privilegeCode) ? null : privilegeCode.trim();
    }

    public String getPrivilegeName() {
        return privilegeName;
    }

    public void setPrivilegeName(String privilegeName) {
        this.privilegeName = StringUtils.isBlank(privilegeName) ? null : privilegeName.trim();
    }

    public String getPrivilegeType() {
        return privilegeType;
    }

    public void setPrivilegeType(String privilegeType) {
        this.privilegeType = StringUtils.isBlank(privilegeType) ? null : privilegeType.trim();
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = StringUtils.isBlank(url) ? null : url.trim();
    }

    public Long getPid() {
        return pid;
    }

    public void setPid(Long pid) {
        this.pid = pid;
    }

    public String getRcState() {
        return rcState;
    }

    public void setRcState(String rcState) {
        this.rcState = StringUtils.isBlank(rcState) ? null : rcState.trim();
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }

    public Long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public Long getModifyUserId() {
        return modifyUserId;
    }

    public void setModifyUserId(Long modifyUserId) {
        this.modifyUserId = modifyUserId;
    }
    
    @Override
    public boolean equals(Object obj) {
    	if (this == obj)
    		return true;
    	if (null == obj)
    		return false;
    	if (!(obj instanceof DefPrivilege))
    		return false;
    	DefPrivilege p = (DefPrivilege) obj;
    	if (p.getPrivilegeId() != privilegeId)
    		return false;
    	if (!privilegeCode.equals(p.getPrivilegeCode()))
    		return false;
    	if (!privilegeName.equals(p.getPrivilegeName()))
    		return false;
    	if (!privilegeType.equals(p.getPrivilegeType()))
    		return false;
    	if (!url.equals(p.getUrl()))
    		return false;
    	if (!pid.equals(p.getPid()))
    		return false;
    	if (!icon.equals(p.getIcon()))
    		return false;
        if (!rcState.equals(p.getRcState()))
        	return false;
        if (createUserId != p.getCreateUserId())
        	return false;
        if (modifyUserId != p.getModifyUserId())
        	return false;
        if (!createDate.equals(p.getCreateDate()))
        	return false;
        if (!modifyDate.equals(p.getModifyDate()))
        	return false;
    	return true;
    }
    
    @Override
    public int hashCode() {
    	int n = 17;
    	return n * 29 + privilegeId.hashCode() 
    			+ n * 29 + privilegeCode.hashCode()
    			+ n * 29 + privilegeType.hashCode()
    			+ n * 29 + privilegeName.hashCode()
    			+ n * 29 + icon.hashCode()
    			+ n * 29 + rcState.hashCode()
    			+ n * 29 + createDate.hashCode()
    			+ n * 29 + modifyDate.hashCode()
    			+ n * 29 + createUserId.hashCode()
    			+ n * 29 + modifyUserId.hashCode();
    }
}